import {options} from "@/api/http"

export function getAllUsers(){
  return options({
    url:'dbUser/getAllUsers',
    method:'get'
  })
}

export function login({name,password}){
  return options({
    url:'dbUser/login',
    method:'post',
    data:{
      name,
      password
    }
  })
}

export function register({name,password,permissions,department,phone}){
  return options({
    url:'/dbUser/register',
    method:'post',
    data:{
      name,
      password,
      permissions,
      department,
      phone
    }
  })
}


export function editRoot({name,permissions}){
  return options({
    url:'/dbUser/updatePer',
    method:'post',
    data:{
      name,
      permissions
    }
  })
}


export function editPassword({name,password}){
  return options({
    url:'/dbUser/updatePwd',
    method:'post',
    data:{
      name,
      password
    }
  })
}


export function delUser({name}){
  return options({
    url:'/dbUser/delete',
    method:'post',
    data:{
      name,
    }
  })
}
